package main

import (
	"fmt"
	"time"
)

var ch3 chan int = make(chan int)

func foo3(id int) { //id: 这个routine的标号.xyz
	ch3 <- id
}

func main() {
	// 开启5个routine
	for i := 0; i < 5; i++ {
		go foo3(i)
		time.Sleep(time.Microsecond * 20)
	}

	// 取出信道中的数据
	for i := 0; i < 5; i++ {
		fmt.Print(<-ch3)
	}
}
